package cn.com.utils;

/**
 * @author ：khc
 * @date ：Created in 2021/12/21 16:36
 * @description：分页处理
 * @modified By：
 * @version: $
 */
public class PageBean {
    private int curPage;//当前页码
    private int rowsPrePage;//每页显示的条数
    private int maxPage;//总页码
    private int maxCount;//最大记录数

    public PageBean(int maxCount,int rowsPrePage){
        this.maxCount = maxCount;
        this.rowsPrePage = rowsPrePage;
        //计算总页码
        maxPage();
    }
    private void maxPage(){
        if(maxCount%rowsPrePage==0){
            maxPage = maxCount/rowsPrePage;
        }else{
            maxPage = maxCount/rowsPrePage+1;
        }
    }

    public int getCurPage() {
        return curPage;
    }

    public void setCurPage(int curPage) {
        this.curPage = curPage;
    }

    public int getRowsPrePage() {
        return rowsPrePage;
    }

    public void setRowsPrePage(int rowsPrePage) {
        this.rowsPrePage = rowsPrePage;
    }

    public int getMaxPage() {
        return maxPage;
    }

    public void setMaxPage(int maxPage) {
        this.maxPage = maxPage;
    }

    public int getMaxCount() {
        return maxCount;
    }

    public void setMaxCount(int maxCount) {
        this.maxCount = maxCount;
    }
}
